<template>
	<view class="column bg-white with-100">
		<!-- 用户协议 -->
		<!-- <yzb-terms :termsList="aboutData " v-if="mark == 1"></yzb-terms> -->

		<!-- 隐私政策 -->
		<!-- <yzb-about :aboutData="aboutData" v-if="mark == 2"></yzb-about> -->
		<view v-if="mark == 1">
			<view v-for="(item,index) in aboutData" :key="index" v-if="item.type == 1" class="nodestyle">
				<rich-text :nodes="item.content"></rich-text>
			</view>
		</view>
		<view v-if="mark == 2">
			<view v-for="(item,index) in aboutData" :key="index" v-if="item.type == 2" class="nodestyle">
				<rich-text :nodes="item.content"></rich-text>
			</view>
		</view>
		<view v-if="mark == 3">
			<view v-for="(item,index) in aboutData" :key="index" v-if="item.type == 3" class="nodestyle">
				<rich-text :nodes="item.content"></rich-text>
			</view>
		</view>
	</view>
</template>

<script>
import yzbTerms from '@/components/yzb/yzb-terms.vue';
import yzbAbout from '@/components/yzb/yzb-about.vue';
export default {
	components: {
		yzbTerms,
		yzbAbout
	},
	data() {
		return {
			mark: 1,
			title: '',
			aboutData: '',			
		};
	},

	onLoad(option) {
		if (option.type == 1) {
			this.title = '用户协议';
			this.getProtocolList();
			this.mark = 1;
		} else if(option.type == 2) {
			this.title = '隐私政策';
			this.getProtocolList();
			this.mark=2;
		}else{
			this.title = '加入我们';
			this.getProtocolList();
			this.mark=3;
		}
		uni.setNavigationBarTitle({
			title: this.title
		});
		this.getProtocolList();	
	},

	methods: {
		// 获取协议
		async getProtocolList(){
			let res = await this.$apis.getProtocolList();
			if(res){				
				this.aboutData  = res.rows				
			}
		},
	
	}
};
</script>

<style>
	.nodestyle{
		margin-top: 60rpx;
		padding: 0 38rpx;
		text-indent: 48rpx;
		line-height: 56rpx;
	}
</style>
